<ul id="menu" class="nav nav-tabs">
  <?php foreach ($menu as $m) {
    if (!$m->dropdown) {
      if (!$m->dropdown_id) { ?>
        <li id="<?php echo $m->id ?>"><a href="<?php echo base_url($m->url) ?>"><?php echo $m->conteudo ?></a></li>
    <?php }
    } else { ?>
      <li class="dropdown">
        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
          <?php echo $m->conteudo ?> <b class="caret"></b>
        </a>
        <ul class="dropdown-menu">
          <?php foreach ($menu as $submenu) {
            if ($submenu->dropdown_id) { ?>
              <li id="<?php echo $submenu->id ?>"><a href="<?php echo base_url($submenu->url) ?>"><?php echo $submenu->conteudo ?></a></li>
            <?php }
          } ?>
        </ul>
      </li>
    <?php }
  } ?>

  <?php if ($this->session->userdata('nome')) { ?>
    <li><a href="<?php echo base_url('processos') ?>">Processos</a></li>
    <li><a href="#" class="logout"><i class="icon-signout"></i> Sair</a></li>
  <?php } ?>
</ul>